package com.woniu.user.controller;


import com.woniu.entity.Result;
import com.woniu.user.service.IPraiseService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 点赞表 前端控制器
 * </p>
 *
 * @author LiFangyu
 * @since 2023-02-15
 */
@RestController
@RequestMapping("/praise")
public class PraiseController {

    @Autowired
    private IPraiseService praiseService;

    @ApiOperation("点赞")
    @GetMapping("/like/{phone}/{article}")
    public Result like(@PathVariable("phone") String phone,@PathVariable("article") String article) {
        return praiseService.like(phone,article);
    }


    @ApiOperation("取消点赞")
    @GetMapping("/cancelLike/{phone}/{article}")
    public Result cancelLike(@PathVariable("phone") String phone,@PathVariable("article") String article) {
        return praiseService.cancelLike(phone,article);
    }


}
